﻿<UserControl x:Class="Core.Controls.ImageControl" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="80" Height="80">
    <UserControl.Resources>
        <Storyboard x:Key="AnimateRectangle">
            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="Rectangle1"
                             Duration="00:00:0.3" 
                             From="0.0" To="1.0"
                             Storyboard.TargetProperty="(Rectangle.Opacity)">

            </DoubleAnimation>
        </Storyboard>
        <Storyboard x:Key="AnimateRectangle1">
            <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetName="Rectangle1"
                             Duration="00:00:0.3" 
                             From="1" To="0"
                             Storyboard.TargetProperty="(Rectangle.Opacity)">

            </DoubleAnimation>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="MainGrid">
        <Grid.Triggers>
            <EventTrigger RoutedEvent="Grid.MouseEnter">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource AnimateRectangle}" />
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Grid.MouseLeave">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource AnimateRectangle1}" />
                </EventTrigger.Actions>
            </EventTrigger>
        </Grid.Triggers>
        <Border>
            <Grid x:Name="ImageGrid" MouseLeftButtonDown="ImageGrid_MouseLeftButtonDown">
                <Rectangle x:Name="Rectangle1" Visibility="Visible" RadiusX="5" RadiusY="5" Opacity="0"
                           Style="{DynamicResource HoverImageBackground}"></Rectangle>
                <Image x:Name="Image1" Stretch="Uniform" Margin="3"
                       Source="Images\image.png">
                    <!--<Image.Effect>
                        <DropShadowEffect Color="LightGray" ShadowDepth="2" Direction="5" BlurRadius="5" Opacity="1" />
                    </Image.Effect>-->
                </Image>
                <CheckBox Height="16" HorizontalAlignment="Left" Margin="9,56,0,0" Name="CheckBox1" VerticalAlignment="Top" Width="20"
                          Opacity="0.7"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
